/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 根据id删除计划 GET /tourism/client/c/plan/deleteplan */
export async function deletePlanUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.deletePlanUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultString_>('/tourism/client/c/plan/deleteplan', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 分页获取计划 GET /tourism/client/c/plan/getplan */
export async function getPlanUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.getPlanUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultPagePlan_>('/tourism/client/c/plan/getplan', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 根据id获取计划 GET /tourism/client/c/plan/getplanbyid */
export async function getPlanByIdUsingGet({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.getPlanByIdUsingGETParams;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultPlan_>('/tourism/client/c/plan/getplanbyid', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 保存计划 POST /tourism/client/c/plan/saveplan */
export async function getPlanUsingPost({
  body,
  options,
}: {
  body: API.Plan;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultString_>('/tourism/client/c/plan/saveplan', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id修改计划 POST /tourism/client/c/plan/updateplan */
export async function updatePlanUsingPost({
  body,
  options,
}: {
  body: API.PlanEditParam;
  options?: CustomRequestOptions;
}) {
  return request<API.CommonResultString_>('/tourism/client/c/plan/updateplan', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
